
package controller;




import bo.BUS_SanPham;
import com.opensymphony.xwork2.ActionSupport;
import dto.DTO_SanPham;




public class ThemSanPhamAction extends ActionSupport {


    private String chon;
    private String gtTimKiem;




    private String TenSP;
    private int GiaMua;
    private int GiaBan;
    private int LoaiSP;
    private int ChuDe;
    private int GioiTinh;
    private String HinhAnh;
    private String ThongTin;

    public int getChuDe() {
        return ChuDe;
    }

    public void setChuDe(int ChuDe) {
        this.ChuDe = ChuDe;
    }

    public int getGiaBan() {
        return GiaBan;
    }

    public void setGiaBan(int GiaBan) {
        this.GiaBan = GiaBan;
    }

    public int getGiaMua() {
        return GiaMua;
    }

    public void setGiaMua(int GiaMua) {
        this.GiaMua = GiaMua;
    }

    public int getGioiTinh() {
        return GioiTinh;
    }

    public void setGioiTinh(int GioiTinh) {
        this.GioiTinh = GioiTinh;
    }

    public String getHinhAnh() {
        return HinhAnh;
    }

    public void setHinhAnh(String HinhAnh) {
        this.HinhAnh = HinhAnh;
    }

    public int getLoaiSP() {
        return LoaiSP;
    }

    public void setLoaiSP(int LoaiSP) {
        this.LoaiSP = LoaiSP;
    }

    public String getTenSP() {
        return TenSP;
    }

    public void setTenSP(String TenSP) {
        this.TenSP = TenSP;
    }

    public String getThongTin() {
        return ThongTin;
    }

    public void setThongTin(String ThongTin) {
        this.ThongTin = ThongTin;
    }

    public String getChon() {
        return chon;
    }

    public void setChon(String chon) {
        this.chon = chon;
    }

    public String getGtTimKiem() {
        return gtTimKiem;
    }

    public void setGtTimKiem(String gtTimKiem) {
        this.gtTimKiem = gtTimKiem;
    }

  

    public ThemSanPhamAction() {

    }



    public String execute() throws Exception {

       DTO_SanPham sp = new DTO_SanPham();
       sp.setTenSP(TenSP);
       sp.setGiaMua(GiaMua);
       sp.setGiaBan(GiaBan);
       sp.setLoaiSP(LoaiSP);
       sp.setChuDe(ChuDe);
       sp.setGioiTinh(GioiTinh);
       sp.setThongTin(ThongTin);
       sp.setHinhAnh(HinhAnh);

       BUS_SanPham busSP = new BUS_SanPham();
       boolean flag = busSP.themsanpham(sp);
       if(flag == true)
       {
      
            return "success";
       }
       return "fail";

    }



}